﻿
@*<h2>@ViewBag.Title</h2>*@
@*<h3>@ViewBag.Message</h3>*@



<section>
    <div class="box-static box-border-top padding-0">
        <div class="box-title margin-bottom-30">
            <h2 class="size-20">Group Stats</h2>
            <p>@ViewBag.Title</p>
            <p>(<b>NOTE</b> - <i>you must play at least 20 games to be included</i>)</p>
        </div>
        <div id="groupStats" class="table-responsive">
            Loading...
        </div>

    </div>
</section>

<script>

    function wait(ms) {
        var start = new Date().getTime();
        var end = start;
        while (end < start + ms) {
            end = new Date().getTime();
        }
    };

    function loadCSS(href) {

        var cssLink = $("<link>");
        $("head").append(cssLink); //IE hack: append before setting href

        cssLink.attr({
            rel:  "stylesheet",
            type: "text/css",
            href: href
        });
        var group = false;
        var player = false;
        var global = false;
        var id = 0;
    };
    var id = @ViewBag.Id;


    $('#groupStats').html('Loading...');

    $.ajax({
        type: "GET",
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        data: { groupid: id },
        url: '/Stats/GroupStats/',
        error: function (error) {
            console.log(error);
            $('#groupStats').html(error);
        },
        success: function (d) {
            $('#groupStats').html(d);

        }
    });


</script>
